package com.sl.biz.modular.process.dao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sl.biz.modular.process.dao.domain.entity.ProcessVersionContentDO;
import com.sl.biz.modular.process.dao.mapper.ProcessVersionContentMapper;
import com.sl.biz.modular.process.dao.service.ProcessVersionContentDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;


@Service
@RequiredArgsConstructor
public class
ProcessVersionContentDaoServiceImpl extends ServiceImpl<ProcessVersionContentMapper, ProcessVersionContentDO> implements ProcessVersionContentDaoService {
    @Override
    public ProcessVersionContentDO queryByProcessVersionId(String processVersionId) {
        LambdaQueryWrapper<ProcessVersionContentDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(ProcessVersionContentDO::getProcessVersionId, processVersionId);
        return super.getOne(lambdaQueryWrapper);
    }

    @Override
    public Boolean deleteByProcessVersionId(String processVersionId) {
        LambdaQueryWrapper<ProcessVersionContentDO> lambdaUpdateWrapper = new LambdaQueryWrapper<>();
        lambdaUpdateWrapper.eq(ProcessVersionContentDO::getProcessVersionId, processVersionId);
        return super.remove(lambdaUpdateWrapper);
    }
}
